function getTime(time: string) {
  console.log('time', time);

  const now = new Date();
  const nowYear = now.getFullYear();
  const targetTime = new Date(time);
  const year = targetTime.getFullYear();
  let month: number | string = targetTime.getMonth() + 1;
  month = month >= 10 ? month : `0${month}`;
  let day: number | string = targetTime.getDate();
  day = day >= 10 ? day : `0${day}`;
  let hours: number | string = targetTime.getHours();
  hours = hours >= 10 ? hours : `0${hours}`;
  let minutes: number | string = targetTime.getMinutes();
  minutes = minutes >= 10 ? minutes : `0${minutes}`;
  // const seconds = targetTime.getSeconds();
  // seconds = seconds >= 10 ? seconds : `0${seconds}`;
  if (year === nowYear) {
    return `${month}月${day}日 ${hours}:${minutes}`;
  }
  return `${year}年${month}月${day}日 ${hours}:${minutes}`;
}

export { getTime };
